package com.sz.stock.client;


import com.alibaba.fastjson.JSON;
import com.sz.stock.common.PageBean;
import com.sz.stock.common.ResultBean;
import com.sz.stock.model.Bankcard;
import com.sz.stock.model.Moneytrad;
import com.sz.stock.model.TUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.time.Duration;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

@Component
public class UserClientImpl implements UserClient {

    private StringRedisTemplate redisTemplate;

    @Autowired
    public StringRedisTemplate getRedisTemplate() {
        return redisTemplate;
    }

    @Override
    public void testConnection() {

    }

    @Override
    public ResultBean register(TUser user) {
        return null;
    }

    @Override
    public ResultBean openAccount(TUser user, String bankCardNumber) {
        return new ResultBean(101, "熔断器返回的null", null);
    }

    @Override
    public ResultBean recharge(BigDecimal money) {
        return new ResultBean(101, "熔断器返回的null", null);
    }

    @Override
    public ResultBean resultLogin(String userphone, String userpwd) {
        return new ResultBean(101, "熔断器返回的null", null);
    }

    @Override
    public String sendCode(String userphone) throws Exception {
        return null;
    }

    @Override
    public ResultBean resetPassword(String userphone, String userupwd, String usercode) {
        return null;
    }

    @Override
    public Boolean openCode(String code) {
        return null;
    }

    @Override
    public List<TUser> getAllmoney(int userid) {
        return null;
    }

    @Override
    public ResultBean topup(int userid, BigDecimal balance) {
        return null;
    }

    @Override
    public ResultBean withdraw(int userid, BigDecimal balance) {
        return null;
    }

    @Override
    public ResultBean Modification(int userid, String olduserpwd, String newuserpwd) {
        return new ResultBean(101, "熔断器返回的null", null);
    }

    @Override
    public ResultBean ModifName(int userid, String username) {
        return new ResultBean(101, "熔断器返回的null", null);
    }

    @Override
    public Bankcard selectBankCardByUserID(int userid) {
        return null;
    }


    /**
     * 根据userid查找银行卡；
     */
    @Override
    public ResultBean searchBankCard(String userid) {
        return new ResultBean(101, "熔断器返回的null", null);
    }


    @Override
    public TUser selectTUserByUserID(int userid) {
        return null;
    }

    @Override
    public PageBean<Moneytrad> getAllCarByid(int userid, int pageIndex, int pageSize) {
        return null;
    }



}
